#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
基础用户
@file base_user.py
@author weiximei
@date 2025/2/27 17:26
"""


class BaseUser:
    """基础用户"""

    # 登录类型
    __loginType: str = None
    # 设备类型
    __deviceType: str = None
    # 租户ID
    __tenantId: str = None
    # 用户ID
    __userId: str = None
    # token
    __token: str = None
    # token过期时间
    __expireTime: str = None
    # 登录IP地址
    __ipaddr: str = None
    # 登录地点
    __loginLocation: str = None
    # 浏览器类型
    __browser: str = None
    # 操作系统
    __os: str = None
    # 菜单权限
    __menuPermission: {} = None
    # 角色权限
    __rolePermission: {} = None
    # 用户名
    __username: str = None

    def __init__(self, login_type: str = None, device_type: str = None, tenant_id: str = None,
                 user_id: str = None, token: str = None, expire_time: str = None,
                 ipaddr: str = None, login_location: str = None, browser: str = None,
                 os: str = None, menu_permission: dict = None, role_permission: dict = None,
                 username: str = None) -> None:
        self.__loginType = login_type
        self.__deviceType = device_type
        self.__tenantId = tenant_id
        self.__userId = user_id
        self.__token = token
        self.__expireTime = expire_time
        self.__ipaddr = ipaddr
        self.__loginLocation = login_location
        self.__browser = browser
        self.__os = os
        self.__menuPermission = menu_permission if menu_permission is not None else {}
        self.__rolePermission = role_permission if role_permission is not None else {}
        self.__username = username

    @property
    def login_type(self) -> str:
        return self.__loginType

    @login_type.setter
    def login_type(self, value: str) -> None:
        self.__loginType = value

    @property
    def device_type(self) -> str:
        return self.__deviceType

    @device_type.setter
    def device_type(self, value: str) -> None:
        self.__deviceType = value

    @property
    def tenant_id(self) -> str:
        return self.__tenantId

    @tenant_id.setter
    def tenant_id(self, value: str) -> None:
        self.__tenantId = value

    @property
    def user_id(self) -> str:
        return self.__userId

    @user_id.setter
    def user_id(self, value: str) -> None:
        self.__userId = value

    @property
    def token(self) -> str:
        return self.__token

    @token.setter
    def token(self, value: str) -> None:
        self.__token = value

    @property
    def expire_time(self) -> str:
        return self.__expireTime

    @expire_time.setter
    def expire_time(self, value: str) -> None:
        self.__expireTime = value

    @property
    def ipaddr(self) -> str:
        return self.__ipaddr

    @ipaddr.setter
    def ipaddr(self, value: str) -> None:
        self.__ipaddr = value

    @property
    def login_location(self) -> str:
        return self.__loginLocation

    @login_location.setter
    def login_location(self, value: str) -> None:
        self.__loginLocation = value

    @property
    def browser(self) -> str:
        return self.__browser

    @browser.setter
    def browser(self, value: str) -> None:
        self.__browser = value

    @property
    def os(self) -> str:
        return self.__os

    @os.setter
    def os(self, value: str) -> None:
        self.__os = value

    @property
    def menu_permission(self) -> dict:
        return self.__menuPermission

    @menu_permission.setter
    def menu_permission(self, value: dict) -> None:
        self.__menuPermission = value

    @property
    def role_permission(self) -> dict:
        return self.__rolePermission

    @role_permission.setter
    def role_permission(self, value: dict) -> None:
        self.__rolePermission = value

    @property
    def username(self) -> str:
        return self.__username

    @username.setter
    def username(self, value: str) -> None:
        self.__username = value
